package cn.nbt.busManage.repository;

import cn.nbt.busManage.model.entity.Menu;
import cn.nbt.busManage.model.entity.News;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MenuRepository extends JpaRepository<Menu,Integer> {

    @Query("select m from Menu m where CONCAT(m.name, '') like CONCAT('%', :name, '%')")
    List<Menu> findByName(@Param("name") String name);
}
